{% extends 'layout/main.html' %}

{% block main %}
  <div id="main" class="main-container container">

{% if errors %}
<div class="alert alert-danger">
  <a href="#" data-dismiss="alert" class="close">x</a>
  {% for key,value in errors.items() %}
      {% for error in value %} {{error}} {% endfor %}
  {% endfor %}
</div>
{% endif %}

<div class="row">
  <div class="col-md-5 col-md-offset-2">
    <div class="panel panel-default">
      <div class="panel-heading">登录</div>
      <div class="panel-body">
        <form class="simple_form " novalidate="novalidate" id="new_user" action="/login" accept-charset="UTF-8" method="post">
          {{ xsrf_form_html() }}
          <input name="utf8" type="hidden" value="&#x2713;" />
        <div class="form-group">
          <input type="email" class="form-control" placeholder="用户名 / Email" name="email" id="user_login" />
        </div>
        <div class="form-group">
          <input type="password" class="form-control" placeholder="密码" name="password" id="user_password" />
        </div>
        <div class="form-group">
          <input class="form-control" placeholder="验证码" name="_rucaptcha" type="text" autocorrect="off" autocapitalize="off" pattern="[0-9a-z]*" maxlength="4" autocomplete="off" />
        </div>
        <div class="form-group">
          <a class="rucaptcha-image-box" href="#">
            <img class="rucaptcha-image" src="https://ruby-china.org/rucaptcha/" alt="Rucaptcha" />
          </a>
        </div>
        <div class="from-group checkbox">
            <label for="user_remember_me">
              <input name="user[remember_me]" type="hidden" value="0" /><input type="checkbox" value="1" name="user[remember_me]" id="user_remember_me" /> 记住登录状态
            </label>
        </div>
        <div class="form-group">
            <input type="submit" name="commit" value="登录" class="btn btn-primary btn-block" data-disable-with="正在登录" />
        </div>
      </form>
      </div>
      <div class="panel-footer">

  <a href="/register">注册</a>

  <a href="/findpassword">忘记了密码?</a>



      </div>
    </div>
  </div>
  <div class="col-md-3">
    <div class="panel panel-default">
      <div class="panel-heading">用其他平台的帐号登录</div>
      <ul class="list-group">
        <li class="list-group-item"><a class="btn btn-default" href="/account/auth/github"><i class='fa fa-github'></i> GitHub</a> </li>
      </ul>
    </div>
  </div>
</div>

  </div>
{% endblock %}
